{# Copyright 2015 Siemens AG

   Copying and distribution of this file, with or without modification,
   are permitted in any medium without royalty provided the copyright notice and this notice are preserved.
   This file is offered as-is, without any warranty.
#}
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:spdx="http://spdx.org/rdf/terms#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<spdx:SpdxDocument rdf:about="{{ uri }}#SPDXRef-DOCUMENT">
  <spdx:specVersion>SPDX-2.2</spdx:specVersion>
  <spdx:dataLicense rdf:resource="http://spdx.org/licenses/CC0-1.0" />
  <spdx:creationInfo>
    <spdx:CreationInfo>
      <spdx:licenseListVersion>2.6</spdx:licenseListVersion>
      <spdx:creator>Person: {{ userName|e }}</spdx:creator>
      <spdx:creator>Organization: {{ organisation|e }}</spdx:creator>
      <spdx:creator>Tool: spdx2</spdx:creator>
      <spdx:created>{{ 'now'|date('Y-m-d\\TH:i:s\\Z')}}{# date('c') for ISO 8601 is not parsed by spdxTool #}</spdx:created>
    </spdx:CreationInfo>
  </spdx:creationInfo>
  <spdx:name>{{ documentName|e }}</spdx:name>
  <rdfs:comment>
    This document was created using license information and a generator from Fossology.
  </rdfs:comment>
  {% for licenseId,licenseData in licenseTexts %}{% if licenseId starts with 'LicenseRef-' %}
  <spdx:hasExtractedLicensingInfo>
{% if licenseId starts with 'LicenseRef-' %}
    <spdx:ExtractedLicensingInfo rdf:about="{{ uri }}#{{ licenseId|replace({' ': '-'})|url_encode }}">
{% else %}
    <spdx:ExtractedLicensingInfo rdf:about="http://spdx.org/licenses/{{ licenseId|replace({' ': '-'})|url_encode }}">
{% endif %}
      <spdx:licenseId>{{ licenseId|replace({' ': '-'})|e }}</spdx:licenseId>
      <spdx:name>{{ licenseData['name']|e }}</spdx:name>
      <spdx:extractedText><![CDATA[
{{ licenseData['text']|replace({'\f':''})
                      |replace({']]>':']]]]><![CDATA[>'}) }}
      ]]></spdx:extractedText>
    </spdx:ExtractedLicensingInfo>
  </spdx:hasExtractedLicensingInfo>
{% endif %}{% endfor %}
  {{ packageNodes|replace({'\n':'\n  '}) }}
</spdx:SpdxDocument>
</rdf:RDF>
